% FIGURE1B.M
% Y1=-0.05, Y2=0.05

% (a) n=100 
load uniformT100Y005.txt; x1=uniformT100Y005(:,1);y1=uniformT100Y005(:,2);
load truncatednormalT100Y005.txt; y2=truncatednormalT100Y005(:,2); x2=truncatednormalT100Y005(:,1);
load informative1T100Y005.txt; y3=informative1T100Y005(:,2); x3=informative1T100Y005(:,1);
load informative2T100Y005.txt; y4=informative2T100Y005(:,2); x4=informative2T100Y005(:,1);

subplot(2,1,1)
plot(x1,y1,'k-',x2,y2,'k-.',x3,y3,'--',x4,y4,':','linewidth',3)
axis([-3 3 0 5])
legend('Prior 1','Prior 2','Prior 3','Prior 4')
grid on
title('n = 100')

% (b) n= infinity
load uniformTinftyY005.txt; x1=uniformTinftyY005(:,1);y1=uniformTinftyY005(:,2);  y1(1:59,1)=NaN*ones(59,1); y1(end-59+1:end,1)=NaN*ones(59,1);
load truncatednormalTinftyY005.txt; y2=truncatednormalTinftyY005(:,2); x2=truncatednormalTinftyY005(:,1); y2(1:59,1)=NaN*ones(59,1); y2(end-59+1:end,1)=NaN*ones(59,1);

% The informative priors are discrete probability distributions for n=infty:
% Informative prior 1: Vertical line at -0.05 of height 0.99, at +0.05 of height 0.01
% Informative prior 2: Vertical line at -0.05 of height 0.01, at +0.05 of height 0.99.
% For expository purposes we just put a vertical line where the 0.99 probability mass is.

subplot(2,1,2)
plot(x1,y1,'k-',x2,y2,'k-.','linewidth',3)
line([-0.05 -0.05],[0 15],'linewidth',3)   % vertical line to be changed manually to dashed line
line([0.05 0.05],[0 15],'linewidth',3)     % vertical line to be changed manually to dotted line
axis([-3 3 0 15])
legend('Prior 1','Prior 2','Prior 3','Prior 4')
grid on
title('n = \infty')